#include <REGX52.H>
#include "Key.h"
#include "Delay.h"
#include "AT24C02.h"
#include "Nixie.h"
#include "Timer0.h"

unsigned char KeyNum,Temp;
void main(void)
{
	Timer0_Init();
	while(1)
	{
		KeyNum = Key();
		if (KeyNum)
		{
			//Temp = KeyNum;//使用静态数码管显示，有时会出现按键失灵的情况
			Nixie(1,KeyNum);
		}
		//Nixie(1,Temp);
	}
}

void Timer0_Routine(void) interrupt 1
{
	static unsigned int T0Count;
	//TH0寄存器
	TH0 = 0XFC;
	//TL0寄存器
	TL0 = 0X17 + 1;
	T0Count++;
	if (T0Count >= 20)
	{
		T0Count = 0;
		Key_Loop();
	}
}
